package com.xiaobai.feign.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * @Author xiaobai
 * @Description 这个拦截器 每一次请求都会进行调用这个拦截器的
 * @Date created in 9:18 2025/2/6
 */
@Component
public class XTokenRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        System.out.println("进入到了拦截器");
        requestTemplate.header("X-Token", UUID.randomUUID().toString());
    }
}
